<template>
  <v-form
    label-width="140"
    ref="ruleForm"
    :fields="fields"
    :fieldsData="ruleForm"
  >
  </v-form>
</template>
<script>
import formMinxin from "_c/forms/minxins/formMinxin.js";
import { getCommonOptions } from '@/api/common'

export default {
  mixins: [formMinxin],
  props: {
    patchData: Object,
  },
  data() {
    return {
      ruleForm: {
        dailyLimit: '',
        dailyOverdrawLimit: '',     
      },
      typeList: [],
    };
  },
  created() {
    getCommonOptions('YWLX').then(res => {
      this.typeList = res.data.map(d => ({ value: d.dmcode, label: d.dmname }))
    });
    this.initForm(this.patchData);
  },
  watch: {
    patchData: function () {
      this.initForm(this.patchData);
    },
  },
  computed: {
    fields: function(){
      return [
        {
          label: "每日额度：",
          placeholder: "请输入每日额度",
          prop: "dailyLimit",
          type: "inputNumber",
          step: 100,
          max: 1000000000,
          rule: [
            {
              required: true,
              message: "请输入预算金额",
              trigger: "blur",
            },
          ],
        },
        {
          label: "每日可透支额度：",
          placeholder: "请输入每日可透支额度",
          prop: "dailyOverdrawLimit",
          type: "inputNumber",
          step: 100,
          max: 1000000000,
          rule: [
            {
              required: true,
              message: "请输入预算金额",
              trigger: "blur",
            },
          ],
        },
      ]
    }
  }
};
</script>
<style lang="scss">
</style>